package 牛客.笔试.快手;

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
//        System.out.println(sc.next().substring(8,9));
        System.out.println(function(sc.next()));
    }
    public static String function(String s){
        if (s.length()<=15&&s.length()>=7){
            if(ipv4function(s)) return "ipv4";
        }else if(s.length()>15&&s.length()<39){
            if(ipv6function(s))return  "ipv6";
        }
        return "Neither";
    }

    private static boolean ipv6function(String s) {
        String ms = "";
        for(int i=0;i<s.length();i++){
            if (s.substring(i,i+1).equals(":"))
            {
                continue;
            }else{
                if (ms.equals(0)&&s.substring(i, i + 1).equals(0)) return false;
                ms = s.substring(i, i + 1);
                int c = s.substring(i, i + 1).charAt(0);
                if (c>='0'&&c<='9'||c>='a'&&c<='f'||c>='A'&&c<='F'){
                    continue;
                }
                else {return false;}
            }
        }
        return true;
    }

    private static boolean ipv4function(String s) {
        String ms = "";
        for(int i=0;i<s.length();i++){
            if (s.substring(i,i+1).equals("."))
            {
                if(Integer.parseInt(ms)>255){
                    return false;
                }
                ms = "";
                continue;
            }else{
                ms = ms+s.substring(i,i+1);
            }
            if (i==s.length()-1){
                if(Integer.parseInt(ms)>255){
                    return false;
                }
            }
        }
        return true;
    }
}
